---
title: "Tree Data - Tree Selection"
enterprise: true
---
Row Selection can allow users to select rows in a tree structure.

## Selecting Descendants

When using [Multiple Row Selection](./row-selection-multi-row/) with a tree structure, the grid can be configured to impact descendant and
ancestor rows when a row is selected.

To enable hierarchical selection, set the `rowSelection.groupSelects` option to one of the following values:

- `'self'` (default): Selecting a row selects only the row itself.
- `'descendants'`: Selecting a row will select all of its descendants. Its ancestor row will become indeterminate, unless all of its descendant rows are selected.
- `'filteredDescendants'`: Selecting a group row will select all of its descendants that pass the filter. Its ancestor row will become indeterminate, unless all of its descendant rows are selected.

{% gridExampleRunner title="Group Selection" name="group-selection" /%}

## Checkboxes in Group Cells

When using [Row Selection](./row-selection/) with Tree Data, the grid can be configured to render checkboxes in the group cell, to the right of the expand/collapse chevron.

This can be configured by setting the `rowSelection.checkboxLocation` to `'autoGroupColumn'`.

{% gridExampleRunner title="Group Cell Checkboxes" name="group-cell-checkboxes" /%}

The example above demonstrates the following configuration to render checkboxes in the group cell:

```{% frameworkTransform=true %}
const gridOptions = {
    rowSelection: {
        mode: 'multiRow',
        checkboxLocation: 'autoGroupColumn',
        headerCheckbox: false,
    },
}
```

## Next Up
Continue to the next section to learn how to configure [Filtering](./tree-data-filtering/).
